package com.openvas.commons.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.openvas.commons.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

//import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息对象 school_user
 * 
 * @author ruoyi
 * @date 2021-08-19
 */
@ApiModel("用户信息对象")
public class SchoolUser implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @ApiModelProperty(notes = "主键ID",required = true, example = "")
    private Integer id;

    /** 用户账号 */
    @Excel(name = "用户账号")
    @ApiModelProperty(notes = "用户账号",required = false, example = "")
    private String userName;

    /** 昵称 最多20中文 */
    @Excel(name = "昵称 最多20中文")
    @ApiModelProperty(notes = "昵称 最多20中文",required = false, example = "")
    private String nickName;

    /** 真实姓名 最多20中文 */
    @Excel(name = "真实姓名 最多20中文")
    @ApiModelProperty(notes = "真实姓名 最多20中文",required = false, example = "")
    private String realName;

    /** 性别：1男 2女 0保密 */
    @Excel(name = "性别：1男 2女 0保密")
    @ApiModelProperty(notes = "性别：1男 2女 0保密",required = true, example = "")
    private Integer sex;

    /** 邮箱 最多20字符 可用于登录 */
    @Excel(name = "邮箱 最多20字符 可用于登录")
    @ApiModelProperty(notes = "邮箱 最多20字符 可用于登录",required = false, example = "")
    private String email;

    /** 邮箱状态 1激活 0未激活 */
    @Excel(name = "邮箱状态 1激活 0未激活")
    @ApiModelProperty(notes = "邮箱状态 1激活 0未激活",required = true, example = "")
    private Integer emailState;

    /** 手机号码 最多11位  可用于登录 */
    @Excel(name = "手机号码 最多11位  可用于登录")
    @ApiModelProperty(notes = "手机号码 最多11位  可用于登录",required = false, example = "")
    private String phone;

    /** 手机号码状态 1已验证 0未验证 */
    @Excel(name = "手机号码状态 1已验证 0未验证")
    @ApiModelProperty(notes = "手机号码状态 1已验证 0未验证",required = true, example = "")
    private Integer phoneState;

    /** 密码 不能为空 且自定义加密 */
    @Excel(name = "密码 不能为空 且自定义加密")
    @ApiModelProperty(notes = "密码 不能为空 且自定义加密",required = true, example = "")
    private String password;

    /** 毕业学校 */
    @Excel(name = "毕业学校")
    @ApiModelProperty(notes = "毕业学校",required = false, example = "")
    private String graduateSchool;

    /** 就职公司 */
    @Excel(name = "就职公司")
    @ApiModelProperty(notes = "就职公司",required = false, example = "")
    private String company;

    /** 地址 */
    @Excel(name = "地址")
    @ApiModelProperty(notes = "真实姓名 最多20中文",required = false, example = "")
    private String address;

    /** 个性签名 中文不能超过75个 */
    @Excel(name = "个性签名 中文不能超过75个")
    @ApiModelProperty(notes = "个性签名 中文不能超过75个",required = false, example = "")
    private String signature;

    /** 头像路径 */
    @Excel(name = "头像路径")
    @ApiModelProperty(notes = "头像路径",required = false, example = "")
    private String headImgUrl;

    /** 删除标志（0代表存在 2代表删除） */
    @ApiModelProperty(notes = "删除标志（0代表存在 2代表删除）",required = false, example = "")
    private String delFlag;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(notes = "最后登录时间",required = true, example = "")
    private Date lastLoginDate;

    /** 出生日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name="出生日期",width=20,dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(notes = "出生日期",required = false, example = "")
    private Date birthday;

    /** 用户状态 1正常 2未激活 0黑名单 */
    @Excel(name = "用户状态 1正常 2未激活 0黑名单")
    @ApiModelProperty(notes = "用户状态 1正常 2未激活 0黑名单",required = true, example = "")
    private Integer userState;

    /** 注册时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(notes = "注册时间",required = true, example = "")
    private Date registerDate;

    /** 经验值 默认0 */
    @Excel(name = "经验值 默认0")
    @ApiModelProperty(notes = "经验值 默认0",required = true, example = "")
    private Integer experienceVul;

    /** 虚拟币 默认0 */
    @Excel(name = "虚拟币 默认0")
    @ApiModelProperty(notes = "虚拟币 默认0",required = true, example = "")
    private Integer coinNumber;

    /** 已购买靶场 默认0 */
    @Excel(name = "已购买靶场 默认0")
    @ApiModelProperty(notes = "已购买靶场 默认0",required = true, example = "")
    private Integer rangeNumber;

    /** 排序 */
    @Excel(name = "排序")
    @ApiModelProperty(notes = "排序",required = false, example = "")
    private Integer sort;

    /** 插入时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss ")
    @Excel(name = "插入时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(notes = "插入时间",required = false, example = "")
    private Date insertDate;

    /** 修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(notes = "修改时间",required = false, example = "")
    private Date updateDate;

    /** 备注（备用字段） */
    @Excel(name = "备注", readConverterExp = "备=用字段")
    @ApiModelProperty(notes = "备注",required = false, example = "")
    private String note;

    /** 收件人姓名*/
    @Excel(name = "收件人姓名")
    @ApiModelProperty(notes = "收件人姓名",required = false, example = "")
    private String addressee;

    /** 收件人手机号*/
    @Excel(name = "收件人手机号")
    @ApiModelProperty(notes = "收件人手机号",required = false, example = "")
    private String expressPhone;

    /** 收件地址*/
    @Excel(name = "收件地址")
    @ApiModelProperty(notes = "收件地址",required = false, example = "")
    private String expressAddress;

    /** 用户角色*/
    @Excel(name = "用户角色")
    @ApiModelProperty(notes = "用户角色",required = false, example = "")
    private Integer roleType;


    public Integer getCredit() {
        return credit;
    }

    public void setCredit(Integer credit) {
        this.credit = credit;
    }

    /** 邀请码*/
    @Excel(name = "邀请码")
    @ApiModelProperty(notes = "邀请码",required = false, example = "")
    private String invitationCode;

    /** 剩余邀请人数*/
    @Excel(name = "剩余邀请人数")
    @ApiModelProperty(notes = "剩余邀请人数",required = false, example = "")
    private int invitationNumber;

    /** 邮箱找回密码的唯一标识*/
    @Excel(name = "邮箱找回密码的唯一标识")
    @ApiModelProperty(notes = "邮箱找回密码的唯一标识",required = false, example = "")
    private String validataCode;

    /** 邮箱发送邮件的时间*/
    @Excel(name = "邮箱发送邮件的时间")
    @ApiModelProperty(notes = "邮箱发送邮件的时间",required = false, example = "")
    private Long outDate;

    /** 发布文章所获取的积分 */
    @Excel(name = "积分")
    @ApiModelProperty(notes = "插入时间",required = false, example = "")
    private Integer credit;

    public String getInvitationCode() {
        return invitationCode;
    }

    public void setInvitationCode(String invitationCode) {
        this.invitationCode = invitationCode;
    }

    public int getInvitationNumber() {
        return invitationNumber;
    }

    public void setInvitationNumber(int invitationNumber) {
        this.invitationNumber = invitationNumber;
    }

    public String getAddressee() {
        return addressee;
    }

    public void setAddressee(String addressee) {
        this.addressee = addressee;
    }

    public String getExpressPhone() {
        return expressPhone;
    }

    public void setExpressPhone(String expressPhone) {
        this.expressPhone = expressPhone;
    }

    public String getExpressAddress() {
        return expressAddress;
    }

    public void setExpressAddress(String expressAddress) {
        this.expressAddress = expressAddress;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }
    public void setNickName(String nickName) 
    {
        this.nickName = nickName;
    }

    public boolean isAdmin()
    {
        return isAdmin(this.id);
    }

    public static boolean isAdmin(Integer id)
    {
        return id != null && 1L == id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNickName()
    {
        return nickName;
    }
    public void setRealName(String realName) 
    {
        this.realName = realName;
    }

    public String getRealName() 
    {
        return realName;
    }
    public void setSex(Integer sex) 
    {
        this.sex = sex;
    }

    public Integer getSex() 
    {
        return sex;
    }
    public void setEmail(String email) 
    {
        this.email = email;
    }

//    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    public String getEmail()
    {
        return email;
    }
    public void setEmailState(Integer emailState) 
    {
        this.emailState = emailState;
    }

    public Integer getEmailState() 
    {
        return emailState;
    }
    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

//    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
    public String getPhone()
    {
        return phone;
    }
    public void setPhoneState(Integer phoneState) 
    {
        this.phoneState = phoneState;
    }

    public Integer getPhoneState() 
    {
        return phoneState;
    }
    public void setPassword(String password) 
    {
        this.password = password;
    }

    @JsonIgnore
    @JsonProperty
    public String getPassword()
    {
        return password;
    }
    public void setGraduateSchool(String graduateSchool) 
    {
        this.graduateSchool = graduateSchool;
    }

    public String getGraduateSchool() 
    {
        return graduateSchool;
    }
    public void setCompany(String company) 
    {
        this.company = company;
    }

    public String getCompany() 
    {
        return company;
    }
    public void setAddress(String address) 
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }
    public void setSignature(String signature) 
    {
        this.signature = signature;
    }

    public String getSignature() 
    {
        return signature;
    }
    public void setHeadImgUrl(String headImgUrl) 
    {
        this.headImgUrl = headImgUrl;
    }

    public String getHeadImgUrl() 
    {
        return headImgUrl;
    }
    public void setLastLoginDate(Date lastLoginDate) 
    {
        this.lastLoginDate = lastLoginDate;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getLastLoginDate() 
    {
        return lastLoginDate;
    }
    public void setUserState(Integer userState) 
    {
        this.userState = userState;
    }

    public Integer getUserState() 
    {
        return userState;
    }
    public void setRegisterDate(Date registerDate) 
    {
        this.registerDate = registerDate;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getRegisterDate() 
    {
        return registerDate;
    }
    public void setExperienceVul(Integer experienceVul) 
    {
        this.experienceVul = experienceVul;
    }

    public Integer getExperienceVul() 
    {
        return experienceVul;
    }
    public void setCoinNumber(Integer coinNumber) 
    {
        this.coinNumber = coinNumber;
    }

    public Integer getCoinNumber() 
    {
        return coinNumber;
    }
    public void setRangeNumber(Integer rangeNumber) 
    {
        this.rangeNumber = rangeNumber;
    }

    public Integer getRangeNumber() 
    {
        return rangeNumber;
    }
    public void setSort(Integer sort) 
    {
        this.sort = sort;
    }

    public Integer getSort() 
    {
        return sort;
    }
    public void setInsertDate(Date insertDate) 
    {
        this.insertDate = insertDate;
    }

    public Date getInsertDate() 
    {
        return insertDate;
    }
    public void setUpdateDate(Date updateDate) 
    {
        this.updateDate = updateDate;
    }

    public Date getUpdateDate() 
    {
        return updateDate;
    }
    public void setNote(String note) 
    {
        this.note = note;
    }

    public String getNote() 
    {
        return note;
    }

    public String getValidataCode() {
        return validataCode;
    }

    public void setValidataCode(String validataCode) {
        this.validataCode = validataCode;
    }

    public Long getOutDate() {
        return outDate;
    }

    public void setOutDate(Long outDate) {
        this.outDate = outDate;
    }

    public Integer getRoleType() {
        return roleType;
    }

    public void setRoleType(Integer roleType) {
        this.roleType = roleType;
    }

    @Override
    public String toString() {
        return "SchoolUser{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", nickName='" + nickName + '\'' +
                ", realName='" + realName + '\'' +
                ", sex=" + sex +
                ", email='" + email + '\'' +
                ", emailState=" + emailState +
                ", phone='" + phone + '\'' +
                ", phoneState=" + phoneState +
                ", password='" + password + '\'' +
                ", graduateSchool='" + graduateSchool + '\'' +
                ", company='" + company + '\'' +
                ", address='" + address + '\'' +
                ", signature='" + signature + '\'' +
                ", headImgUrl='" + headImgUrl + '\'' +
                ", delFlag='" + delFlag + '\'' +
                ", lastLoginDate=" + lastLoginDate +
                ", birthday=" + birthday +
                ", userState=" + userState +
                ", registerDate=" + registerDate +
                ", experienceVul=" + experienceVul +
                ", coinNumber=" + coinNumber +
                ", rangeNumber=" + rangeNumber +
                ", sort=" + sort +
                ", insertDate=" + insertDate +
                ", updateDate=" + updateDate +
                ", note='" + note + '\'' +
                ", addressee='" + addressee + '\'' +
                ", expressPhone='" + expressPhone + '\'' +
                ", expressAddress='" + expressAddress + '\'' +
                ", roleType='" + roleType + '\'' +
                ", invitationCode='" + invitationCode + '\'' +
                ", invitationNumber=" + invitationNumber +
                ", validataCode='" + validataCode + '\'' +
                ", outDate=" + outDate +
                ", credit=" + credit +
                '}';
    }
}
